<html>
<head>
    @include('v1.common.meta')
    <link rel="stylesheet" href="{{elixir('css/basicdata.css')}}">
</head>
<body>
<div class="yjs-grid">
    <div class="yjs-grid-box">
        <div class="layui-tab">
            @if(Auth::check())
                <div class="layui-container">
                    @if($view==='selectMajors')

                        <div class="layui-form layui-form-pane" name="tbMajorForm"
                             action="javascript:;" method="POST">

                            <input type="hidden" name="code" value="{{$code}}">
                            <input type="hidden" name="arrival_code" value="{{$arrival_code}}">

                            <div class="layui-row">
                                <div class="layui-col-md12">
                                    <div class="layui-form-item">
                                        @foreach($majors as $item)
                                            {{--<div class="layui-form-item">--}}
                                            {{--<input type="checkbox" name="major" value="{{$item['code']}}" lay-skin="primary" lay-filter="major" title="{{$item['name']}}">--}}
                                            {{--</div>--}}


                                            @if(in_array($item['code'],$selectedMajor))
                                                <input type="checkbox" name="{{$item['code']}}" lay-skin="primary" lay-filter="major" title="{{$item['name']}}" checked>
                                            @else
                                                <input type="checkbox" name="{{$item['code']}}" lay-skin="primary" lay-filter="major" title="{{$item['name']}}">
                                            @endif
                                        @endforeach

                                    </div>

                                </div>
                            </div>
                            <div class="layui-row">
                                <div class="layui-col-md6">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">验证码</label>
                                        <div class="layui-input-inline">
                                            <input type="text" name="captcha" maxlength="4"
                                                   lay-verify="required"
                                                   placeholder="请输入图片验证码" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-col-md3">
                                    <div class="layui-form-item">
                                        <img class="getLVcode" src="{{ captcha_src('mini') }}"
                                             width="70px"
                                             height="34px" style="border: 1px solid green;"/>
                                        <div class="layui-form-mid layui-word-aux">
                                            点击图片刷新验证码
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-col-md3">
                                    {{--隐藏提交--}}
                                    <button id="toolbarSubmit" type="submit" class="layui-btn"
                                            lay-filter="toolbarEvent" lay-submit style="display: none;">
                                    </button>
                                </div>
                            </div>
                        </div>
                    @else
                        {{--视图类型不正确--}}
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <blockquote class="layui-elem-quote-error">
                                    友情提示：视图类型不正确，无法支持后续操作。
                                </blockquote>
                            </div>
                        </div>
                    @endif
                </div>
            @else
                <div class="layui-container">
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <blockquote class="layui-elem-quote-error">
                                友情提示：该功能只面向已成功登录系统，并具有相应权限的用户可用。
                            </blockquote>
                        </div>
                    </div>
                </div>
            @endif
        </div>
    </div>
</div>

@include('v1.common.js')
<script src="{{elixir('js/textbookMajor.js')}}"></script>
</body>
<script type="text/html">
    <input type="hidden" id="rspStatus" value="">
    <input type="hidden" id="rspMsg" value="">
</script>
<style>
    .layui-form-checkbox span{padding:0 10px;height:5%;font-size:14px;background-color:#d2d2d2;color:#fff;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
</style>
</html>